package com.hrpmar.utils;

import javax.servlet.http.HttpSession;

/**
 * Created by 李松松 on 2017/11/15.
 */
public class SystemContext {

    private static ThreadLocal<HttpSession> sessionT1 = new ThreadLocal<>();

    //获取HttpSession
    public static HttpSession getHtppSession(){
        return sessionT1.get();
    }

    //给session赋值
    public static void setHttpSession(HttpSession session){
        HttpSession _session = sessionT1.get();
        if(_session==null){
            sessionT1.set(session);
        }
    }
    //删除Session
    public static void removeSessionT(){
        HttpSession _session = sessionT1.get();
        if(_session!=null){
            sessionT1.remove();
        }
    }


}
